import asyncio
import datetime

async def my_async_function():
    while True:
        # 执行你的函数或任务
        print(f"Executing function at {datetime.datetime.now()}")

        # 等待 10 分钟
        await asyncio.sleep(1)

if __name__ == "__main__":
    # 创建事件循环
    loop = asyncio.get_event_loop()

    try:
        # 运行异步函数
        loop.run_until_complete(my_async_function())
    except KeyboardInterrupt:
        # 处理键盘中断，例如按下 Ctrl+C
        pass
    finally:
        # 关闭事件循环
        loop.close()
